/**
 * 此文件用于操作会议所需操作
 */

import store from '@/store'

// 生成一个随机的6位的密码
const randomPassword = () => {
  let password = ''
  const charlist = '0123456789'
  for (let i = 0; i < 6; i++) {
    password += charlist.charAt(parseInt(Math.random() * charlist.length))
  }
  return password
}

// 判断是否为主持人
const isHost = (id) => {
  if (store.state.conferenceRoom.cf_host === id) {
    return true
  } else {
    return false
  }
}

export default {
  randomPassword,
  isHost
}
